﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO.Ports;

namespace SHW_UP.BP
{
    class SerialPortSender
    {
        public static void sendStrInfo(string info,SerialPort serialPort1)
        {
            byte[] data = InfoUtils.GetXORFull(Encoding.UTF8.GetBytes(info));
            //string str = Convert.ToBase64String(data);
            serialPort1.Write(data, 0, data.Length);
            //serialPort1.WriteLine(info);
        }

        public static void sendHexInfo(string info,SerialPort serialPort1)
        {
            byte[] data = InfoUtils.GetXORFull(InfoUtils.strToHexByte(info));
            serialPort1.Write(data, 0, data.Length);
        }
    }
}
